<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  
</body>
<script type="text/javascript">
  var arr = [1,2,3,5,9,4,6,8];  ///旧数组. 添加: 7,101,11
  var arr2 = [2,4,6,7,101,11];   ///新数组.  删除: 1,3,5,9,8
  function filterArr(arr,val){
    return arr.find(function(value,i){
      return value == val;
    });
  };
  var arrAll = arr.concat(arr2);
  var results = {
    add: [],
    del: []
  }
  arrAll.forEach(function(val,i){
    !filterArr(arr,val) && results.add.push(val);
    !filterArr(arr2,val) && results.del.push(val);
  });
  console.log(results);
</script>
</html>
